package com.linkhub.oms.component.aliyunoss.dto;

import lombok.Data;

import java.io.Serializable;

/**
 * @Description: PutObjectResultDTO
 * @Author: echo
 * @Date: 2024/5/8 20:22
 * @Version: 1.0
 */
@Data
public class PutObjectResultDTO implements Serializable {

    private String url;

    private String objectName;

    public static PutObjectResultDTO create(String objectName, String endpoint) {
        PutObjectResultDTO dto = new PutObjectResultDTO();
        dto.setObjectName(objectName);
        dto.setUrl(String.format("%s/%s", endpoint, objectName));

        return dto;
    }

}
